package com.me.composite;

import lombok.Data;

/**
 * 用此类来描述学校、院、系
 * get、set方法使用@Data
 */
@Data
public abstract class OrganizationComponent {

    /**
     * 名字
     */
    private String name;

    /**
     * 说明
     */
    private String des;

    protected void add(OrganizationComponent organizationComponent) {
        // 默认实现
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationComponent organizationComponent) {
        // 默认实现
        throw new UnsupportedOperationException();
    }

    // 构造器
    public OrganizationComponent(String name, String des) {
        this.name = name;
        this.des = des;
    }

    /**
     * 方法print, 做成抽象的, 子类都需要实现
     */
    protected abstract void print();
}
